package cn.youyeku.sockettransmission.utils;

import android.util.Log;

import cn.youyeku.sockettransmission.ui.ConstantAppConfig;

/**
 * Created by youye on 17-6-12.
 */

public class ReadWriteXml {



    public ReadWriteXml writeString(String key, String value) {
        ConstantAppConfig.mEditor.putString(key, value);
        return this;
    }

    public ReadWriteXml writeInt(String key, int value) {
        ConstantAppConfig.mEditor.putInt(key, value);
        return this;
    }

    public ReadWriteXml writeBoolean(String key, boolean value) {
        ConstantAppConfig.mEditor.putBoolean(key, value);
        return this;
    }

    public ReadWriteXml writeFloat(String key, float value) {
        ConstantAppConfig.mEditor.putFloat(key, value);
        return this;
    }


    public void commit() {
        LogUtils.w("应用更改" );
        ConstantAppConfig.mEditor.commit();
    }


    public String getString(String key, String default_value) {

        return ConstantAppConfig.mSharedPreferences.getString(key, default_value);

    }

    public int getInt(String key, int default_value) {

        return ConstantAppConfig.mSharedPreferences.getInt(key,default_value);

    }

}
